<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Clanpage using webSPELL 4 CMS" />
<meta name="author" content="webspell.org" />
<meta name="keywords" content="webspell, webspell4, clan, cms" />
<meta name="copyright" content="Copyright &copy; 2005 - 2009 by webspell.org" />
<meta name="generator" content="webSPELL" />

<!-- Head & Title include -->
<title>Article</title>
<link href="_stylesheet.css" rel="stylesheet" type="text/css" />
<script src="js/bbcode.js" type="text/javascript"></script>
	
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="js/ckeditor/adapters/jquery.js"></script>

<!-- end Head & Title include -->
<script type="text/javascript">
<!--

CKEDITOR.config.contentsCss = '_stylesheet.css';
CKEDITOR.config.width = $picsize_l;
CKEDITOR.config.filebrowserBrowseUrl = 'upload.php?articlesID=$articlesID';
CKEDITOR.config.filebrowserUploadUrl = 'upload.php?articlesID=$articlesID';
CKEDITOR.config.filebrowserWindowWidth = 800;
CKEDITOR.config.filebrowserWindowHeight = 600;

function chkFormular() {
	if(document.getElementById('article_title').value == "") {
		alert("%enter_title%");
		document.post.title.focus();
   		return false;
	}
}

message = new Array();

function update_textarea(value) {
	$("#articles_textarea textarea").each(function(index) {
		message[index] = $(this).val();
		var editor = $(this).ckeditorGet();
		if (editor) {
			editor.destroy()
		}
	});
	document.getElementById('articles_textarea').innerHTML='';
	for(i=0;i<value;++i) {
		if(message[i]) document.getElementById('articles_textarea').innerHTML+='%page% '+(i + 1)+'<br /><textarea name="message[' + i + ']" rows="20">'+message[i]+'</textarea><br/><br/>';
		else {
			message[i] = '';
			document.getElementById('articles_textarea').innerHTML+='%page% '+ (i + 1) +'<br /><textarea name="message[' + i + ']" rows="20"></textarea><br/><br/>';
		}
	}
	$("#articles_textarea textarea").ckeditor();
}

$message_vars

$(document).ready(function() {
	update_textarea($pages);
});

-->
</script>
<style type="text/css">
	body {margin: 0px;}
</style>
</head>
<body>
<form action="articles.php?action=save" method="post" id="post" name="post" onsubmit="return chkFormular()">
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="$border">
  <tr>
    <td class="title" align="center" bgcolor="$bghead">%edit_article%</td>
  </tr>
  <tr><td bgcolor="$pagebg"></td></tr>
  <tr>
    <td bgcolor="$bg1">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top">$addbbcode</td>
        <td valign="top">$addflags</td>
      </tr>
    </table>
     <hr />
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
      <tr align="left">
        <td colspan="2"><b>%pagecount%</b>&nbsp;&nbsp;&nbsp;%page_select%<hr /></td>
      </tr>
      <tr align="left">
        <td colspan="2"><b>%title%</b><br /><br />
        <input name="title" type="text" size="80" value="$title" id='article_title' /></td>
      </tr>
      <tr align="left">
        <td colspan="2"><br /><div id="articles_textarea"></div>
		</td>
      </tr>
      <tr>
        <td><small><b>%options%:</b> %html%</small></td>
        <td align="right"></td>
      </tr>
      <tr>
        <td colspan="2"><hr /></td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td>%link% 1:
        <input name="link1" type="text" value="$link1" />
        <input name="url1" type="text" value="$url1" />
        $window1</td>
      </tr>
      <tr>
        <td>%link% 2:
        <input name="link2" type="text" value="$link2" />
        <input name="url2" type="text" value="$url2" />
        $window2</td>
      </tr>
      <tr>
        <td>%link% 3:
        <input name="link3" type="text" value="$link3" />
        <input name="url3" type="text" value="$url3" />
        $window3</td>
      </tr>
      <tr>
        <td>%link% 4:
        <input name="link4" type="text" value="$link4" />
        <input name="url4" type="text" value="$url4" />
        $window4</td>
      </tr>
      <tr>
        <td><hr /></td>
      </tr>
      <tr>
        <td align="right">
        <input type="hidden" name="articlesID" value="$articlesID" />
        <input type="hidden" name="userID" value="$userID" />
        <select name="comments">$comments</select>
        <input name="post" type="submit" value="%save_article%" />
        <input name="button" type="button" onclick="window.close()" value="%cancel%" /></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</form>
</body>
</html>